#ifndef HTTP_H
#define HTTP_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QFile>

class Http : public QObject
{
    Q_OBJECT
public:
    explicit Http(QObject *parent = nullptr);
    void startRequst(QUrl url);

private:
    QNetworkAccessManager networkManager;
    QNetworkReply *       reply;
    QFile *               downloadFile;

signals:
    void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
    void downloadFileFinished();

public slots:
    void httpReadyRead();
    void httpFinished();
    void httpdownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
};

#endif  // HTTP_H
